package com.jwater.web.ui.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;

import com.jwater.web.ui.tag.components.TabPage;
import com.opensymphony.xwork2.util.ValueStack;

public class TabPageTag extends AbstractClosingTag {

	private static final long serialVersionUID = -3485900071701196996L;

	protected String selected;
	protected String navigatetype;
	protected String navigateurl;
	protected String allowtargetinblank;
	
	public void setSelected(String selected) {
		this.selected = selected;
	}

	public void setNavigatetype(String navigatetype) {
		this.navigatetype = navigatetype;
	}

	public void setNavigateurl(String navigateurl) {
		this.navigateurl = navigateurl;
	}

	public void setAllowtargetinblank(String allowtargetinblank) {
		this.allowtargetinblank = allowtargetinblank;
	}
	@Override
	protected void populateParams() {
		// TODO Auto-generated method stub
		super.populateParams();
		TabPage tabPage=((TabPage)component);
		tabPage.setSelected(selected);
		tabPage.setNavigatetype(navigatetype);
		tabPage.setNavigateurl(navigateurl);
		tabPage.setAllowtargetinblank(allowtargetinblank);
	}

	@Override
	public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
		return new TabPage(stack, req, res);
	}

}
